﻿<%@ Page Language="C#" MasterPageFile="~/Workflow/MasterPage/List2.Master" AutoEventWireup="true" Inherits="Workflow_Configure_WFFlowList" Title="Untitled Page" Codebehind="WFFlowList.aspx.cs" %>
<%@ Import Namespace="Honestysoft.Workflow.Model" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script language="javascript" type="text/javascript">
    //编辑流程属性
    function mNewFlow() {
        var dialog = window.showModalDialog('../WFDesigner/JobTemplateEdit.aspx', window, "dialogWidth:560px; dialogHeight:400px; center:yes; help:no; resizable:no; status:no");
        if (dialog != null) {
            alert(dialog);
            window.location.reload();
            if (parent != null) {
                parent.frames("Left").document.location = '<%=WorkflowApply.Home %>WorkFlow/WFTree/WFTreeLeft.aspx?ID=<%=Request["ID"]+"" %>&WFModule=<%=Request["WFModule"]+"" %>';
            }
        }
    }
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<div class="page_margin" style="margin:10px;" >
    <table width="100%" cellspacing="0" cellpadding="0"> 
    <tr><td align="right">    
    <asp:Button ID="btnCopy" runat="server" Text="复制流程" OnClick="btnCopy_Click" class="btn_normal" onmouseover="this.className='btn_active'" onmouseout="this.className='btn_normal'" />
        <asp:Button ID="btnPaste" runat="server" Text="粘贴流程" OnClick="btnPaste_Click" class="btn_normal" onmouseover="this.className='btn_active'" onmouseout="this.className='btn_normal'" />   
        <% if(Request["ID"]+"" == ((int)WFEnumData.JobTempState.Design).ToString()) { %>        
        <input type="button" class="btn_normal" onmouseover="this.className='btn_active'" onmouseout="this.className='btn_normal'" onclick='javascript:mNewFlow()' name="Submit" value="新增流程" />      
        <asp:Button ID="btnDelete" runat="server" Text="删 除" OnClientClick="return getNoSelectionAlert('chkID','请选择要删除的记录！');" OnClick="btnDelete_Click" class="btn_normal" onmouseover="this.className='btn_active'" onmouseout="this.className='btn_normal'" /> 
        <asp:Button ID="btnActive" runat="server" Text="激 活" OnClick="btnActive_Click" class="btn_normal" onmouseover="this.className='btn_active'" onmouseout="this.className='btn_normal'" />
        <%}
        else if (Request["ID"] + "" == ((int)WFEnumData.JobTempState.Run).ToString()){ %>
        <asp:Button ID="btnCancel" runat="server" Text="作 废" OnClick="btnCancel_Click" class="btn_normal" onmouseover="this.className='btn_active'" onmouseout="this.className='btn_normal'" />
        <%} else {%>
        <asp:Button ID="btnResume" runat="server" Text="恢 复" OnClick="btnResume_Click" class="btn_normal" onmouseover="this.className='btn_active'" onmouseout="this.className='btn_normal'" />
        <%} %>
        </td>
    </tr>
</table>
  <div style="width:100%; padding-top:3px; text-align:center"> 
  <table cellpadding="0" width="100%" cellspacing="0" border="1" class="t1" id="tGrid">
		<thead>  
            <th align="center" width="30px">
                <input type="checkbox" name="chkAll" value="checkbox" onclick='javascript:checkAll(this,"chkID")' />
            </th>
            <th>模板名称</th>
            <th  width="60px">模板类型</th>
            <th>备注</th>
            <th  width="60px">版本</th>
            <th width="80px">状态</th>
            <th width="120px">操作</th>
        </thead>
        <asp:Repeater runat="server" ID="rptList">
			<ItemTemplate>
				<tr>
					<td align="center" >
                        
                <input type="checkbox" name="chkID" id="chk<%# DataBinder.Eval(Container.DataItem,"ID") %>"  value="<%# DataBinder.Eval(Container.DataItem,"ID") %>" >
                    </td>
                    <td><%# DataBinder.Eval(Container.DataItem, "Name")%></td>
                    <td><%# WFPublicFun.GetEnumText(typeof(Honestysoft.Workflow.Model.WFEnumData.TemplateType), DataBinder.Eval(Container.DataItem, "TemplateType") + "")%></td>
                    <td> <%# DataBinder.Eval(Container.DataItem,"Description") %></td>
                    <td><%# DataBinder.Eval(Container.DataItem,"Version") %></td>
                    <td><%# WFPublicFun.GetEnumText(typeof(Honestysoft.Workflow.Model.WFEnumData.JobTempState), DataBinder.Eval(Container.DataItem, "Status") + "")%></td>
                    <td> <%# GetLinkButton(DataBinder.Eval(Container.DataItem, "ID") + "", DataBinder.Eval(Container.DataItem, "Status") + "")%></td>
                </tr>
            </ItemTemplate>
        </asp:Repeater>
   </table>

    
</div>
    
</div>
</asp:Content>

